﻿#pragma once


#include "Pages/EditorPageView.h"
#include "Widgets/CanvasWidget.h"
#include "EditorTextFilePageView.m.h"


class REditorTextFilePageViewModel;

RCLASS()
class REditorTextFilePageView : public REditorPageView
{
    ROBJECT

public:
    virtual void BindViewModel(TSharedObjectPtr<REditorPageViewModel> InViewModel) override;
    virtual void CreateWidget(TSharedObjectPtr<RWidget> InParent) override;

protected:
    TWeakObjectPtr<REditorTextFilePageViewModel> ViewModel;

    //for thumbnail
    CString FormerWholeText;
    TVector<SColorfulTextColor> FormerThumbnailTextColors;
    TSharedObjectPtr<RFont> FormerThumbnailFont;
    SVec2 FormerThumbnailPosition;
    TSharedObjectPtr<RCanvasItem> FormerThumbnailItems;


    //for highlighted text
    CString FormerText;
    TVector<SColorfulTextColor> FormerTextColors;
    TSharedObjectPtr<RFont> FormerFont;
    int64_t FormerFontSize;
    SVec2 FormerPosition;
    TSharedObjectPtr<RCanvasItem> FormerItems;

    //for line number
    float FormerYOffset=0;
    TMap<int32_t, TSharedObjectPtr<RCanvasItem>> FormerLineNumberItems;

};
